home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / mx / messaging / events / ChannelEvent.as next >
Encoding:
Text File  |  2008-05-21  |  1.5 KB  |  52 lines

  1. package mx.messaging.events
  2. {
  3.    import flash.events.Event;
  4.    import mx.messaging.Channel;
  5.    
  6.    public class ChannelEvent extends Event
  7.    {
  8.       public static const CONNECT:String = "channelConnect";
  9.       
  10.       public static const DISCONNECT:String = "channelDisconnect";
  11.       
  12.       public var reconnecting:Boolean;
  13.       
  14.       public var channel:Channel;
  15.       
  16.       public var rejected:Boolean;
  17.       
  18.       public function ChannelEvent(param1:String, param2:Boolean = false, param3:Boolean = false, param4:Channel = null, param5:Boolean = false, param6:Boolean = false)
  19.       {
  20.          super(param1,param2,param3);
  21.          this.channel = param4;
  22.          this.reconnecting = param5;
  23.          this.rejected = param6;
  24.       }
  25.       
  26.       public static function createEvent(param1:String, param2:Channel = null, param3:Boolean = false, param4:Boolean = false) : ChannelEvent
  27.       {
  28.          return new ChannelEvent(param1,false,false,param2,param3,param4);
  29.       }
  30.       
  31.       public function get channelId() : String
  32.       {
  33.          if(channel != null)
  34.          {
  35.             return channel.id;
  36.          }
  37.          return null;
  38.       }
  39.       
  40.       override public function toString() : String
  41.       {
  42.          return formatToString("ChannelEvent","channelId","reconnecting","rejected","type","bubbles","cancelable","eventPhase");
  43.       }
  44.       
  45.       override public function clone() : Event
  46.       {
  47.          return new ChannelEvent(type,bubbles,cancelable,channel,reconnecting,rejected);
  48.       }
  49.    }
  50. }
  51.  
  52.